<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>






	<img src="" alt=""/>

	</body>
    <script>

        var merchantNo = '561611057199534,mt123';
        var merchantNos = merchantNo.split(",");
        console.log("merchantNos: ", merchantNos);
        for (var i = 0; i < merchantNos.length; i++) {
            console.log(merchantNos[i]);
        }

        // console.log(merchantNos[0]);
        // console.log(merchantNos[1]);





		  let  temp = 20525758.45


		function  f (val, fixedNum, currencySymbol) {

			if (val == undefined || val == '' || val == null || val == 'null' || val == 'NULL' || val == 'Null') {
				var ret = currencySymbol ? currencySymbol : '';
				return fixedNum == 0 ? ret + 0 : ret + (0).toFixed(fixedNum);
			}

			// 原数据就已经用逗号隔开，原样返回
			// 不处理fixedNum
			if ((val + '').indexOf(',') != -1) {
				var ret = currencySymbol ? currencySymbol : '';
				return ret + val;
			}

			var str = (val / 1).toFixed(fixedNum) + '';
			var intSum = 0;
			var ret = 0;

			if (fixedNum == 0) {
				intSum = str.replace(/\B(?=(?:\d{3})+$)/g, ',');
				ret = intSum;
			} else {
				intSum = str.substring(0, str.indexOf(".")).replace(/\B(?=(?:\d{3})+$)/g, ','); // 整数部分
				ret = intSum + str.substring(str.length, str.indexOf("."));
			}
			return currencySymbol ? currencySymbol + ret : ret;
		}



		console.log(f(temp, 2));

    </script>
</html>
